<?php
/*
 * 课程
 * @author    Leo
 * @filename Course.php
 * @Created  2015/10/5 23:46
 */

class Course implements  Prototype{

	public  $title;
	public $teacher;
	public $intro;
	public $students = array();

	public function __construct($title,$teacher,$intro){
		$this->title = $title;
		$this->teacher = $teacher;
		$this->intro = $intro;
	}

	public function addStudent(Student $student){
		$this->students[] = $student;
	}


	public function show(){
		echo '课程标题:'.$this->title.PHP_EOL;
		echo '课程老师:'.$this->teacher.PHP_EOL;
		echo '课程介绍:'.$this->intro.PHP_EOL;
		echo '课程学生:'.PHP_EOL;
		if(!empty($this->students)){
			print_r($this->students);
		}

	}

	public function copy(){
		$tmp = serialize($this);
		return unserialize($tmp);
	}
}